package ln.fxspringarchetype.mapper;

import ln.fxspringarchetype.model.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface StudentMapper {
    Student find(@Param("id") int id);

    List<Student> findAll();

    List<Student> findPage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    List<Student> findPageByName(
            @Param("studentName") String studentName,
            @Param("pageNum") int pageNum,
            @Param("pageSize") int pageSize);

    int count();

    int pageCount(@Param("pageSize") int pageSize);

    int pageCountByName(@Param("studentName") String studentName, @Param("pageSize") int pageSize);

    int insert(@Param("student") Student student);

    int insertBatch(@Param("students") List<Student> students);

    int delete(@Param("id") int id);

    int deleteBatch(@Param("students") List<Student> students);

    int update(@Param("student") Student student);

    int updateBatch(@Param("students") List<Student> students);
}
